package com.pro.service.imple;

import com.pro.mapper.JsNewCourseCommentMapper;
import com.pro.mapper.JsNewMicrocircleCommentMapper;
import com.pro.pojo.JsComment;
import com.pro.pojo.JsMicrocircle;
import com.pro.service.JsNewCourseCommentService;
import com.pro.service.JsNewMicrocircleCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cyj
 * @date 2022.3.30$ 13.35$
 * @content :
 */
@Service
public class JsNewMicrocircleCommentServiceImple implements JsNewMicrocircleCommentService {

    @Autowired
    private JsNewMicrocircleCommentMapper mapper;

    /**
     * @author cyj
     * @date 2022.3.30$ 19.15$
     * @content : 统计前台的评论数
     */
    @Override
    public JsMicrocircle getUserComment(Integer id) {
        return mapper.getUserComment(id);
    }

    /**
     * @author cyj
     * @date 2022.3.30$ 19.03$
     * @content : 统计前台的评论数
     */
    @Override
    public JsMicrocircle getBeforeComment(Integer id) {
        return mapper.getBeforeComment(id);
    }

    /**
     * @author cyj
     * @date 2022.3.30$ 18.55$
     * @content : 统计前台的评论数
     */
    @Override
    public Integer countUserComment(Integer type, String status) {
        return mapper.countUserComment(type,status);
    }
    /**
     * @author cyj
     * @date 2022.3.30$ 18.34$
     * @content : 获取后台人员评论计数
     */
    @Override
    public List<JsComment> getUserTable(Integer type, String status, Integer limit, Integer page) {
        System.err.println(page+"---"+limit);
        limit = (limit-1)*page;
        return mapper.getUserTable( type,  status,  limit,  page);
    }

    /**
     * @author cyj
     * @date 2022.3.30$ 16.29$
     * @content : 获取后台人员评论计数
     */
    @Override
    public List<JsComment> getBeforeTable(Integer type, String status, Integer limit, Integer page) {
        System.err.println(page);
        limit = (limit-1)*page;
        return mapper.getBeforeTable(type,status,page,limit);
    }

    /**
     * @author cyj
     * @date 2022.3.29$ 14.42$
     * @content : 获取后台人员评论计数
     */
    @Override
    public Integer countComm(Integer type,String status,String userType,String commentDate) {
        return mapper.countComm(type,status,userType,commentDate);
    }
    /**
     * @author cyj
     * @date 2022.3.29$ 14.42$
     * @content : 获取后台人员计数
     */
    @Override
    public List<JsComment> countPeo(Integer type,String status,String userType,String commentDate) {
        return mapper.countPeo(type,status,userType,commentDate);
    }

    /**
     * @author cyj
     * @date 2022.3.30$ 13.39$
     * @content : 统计前台的评论数
     */
    @Override
    public Integer countBeforeComment(Integer type, String status) {
        return mapper.countBeforeComment(type,status);
    }
}
